from base.page_method import Base_method

class PageLogin(Base_method):
    def __init__(self,base_url,login_locators):
        super().__init__(base_url)
        self.locations = login_locators

    def page_click_login_link(self,needed_key):
        self.base_click(self.locations[needed_key])

    def page_input_username(self,needed_key,username):
        self.base_input(self.locations[needed_key],username)

    def page_input_password(self,needed_key,password):
        self.base_input(self.locations[needed_key],password)

    def page_input_verify_code(self,needed_key,code):
        self.base_input(self.locations[needed_key],code)

    def page_click_login_btn(self,needed_key):
        self.base_click(self.locations[needed_key])

    def page_get_err_info(self,needed_key):
        return self.base_get_text(self.locations[needed_key])

    def page_click_logout_btn(self,needed_key):
        self.base_click(self.locations[needed_key])

    def page_get_screenshot(self):
        self.base_get_image()
